.class public Lcom/fiberhome/xloc/broadcast/AliveService;
.super Landroid/app/Service;


# instance fields
.field a:Ljava/lang/Runnable;

.field private b:I

.field private c:I

.field private d:I

.field private e:I

.field private f:J

.field private g:J

.field private h:J

.field private i:Landroid/os/Handler;


# direct methods
.method public constructor <init>()V
    .locals 2

    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    const/16 v0, 0x3e9

    iput v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->b:I

    const/16 v0, 0x3ea

    iput v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->c:I

    const/16 v0, 0x3eb

    iput v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->d:I

    const/16 v0, 0x3ec

    iput v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->e:I

    const-wide/32 v0, 0x927c0

    iput-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->f:J

    const-wide/16 v0, 0x3a98

    iput-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->g:J

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->h:J

    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    new-instance v0, Lcom/fiberhome/xloc/broadcast/a;

    invoke-direct {v0, p0}, Lcom/fiberhome/xloc/broadcast/a;-><init>(Lcom/fiberhome/xloc/broadcast/AliveService;)V

    iput-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->a:Ljava/lang/Runnable;

    return-void
.end method

.method static synthetic a(Lcom/fiberhome/xloc/broadcast/AliveService;)J
    .locals 2

    iget-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->f:J

    return-wide v0
.end method

.method static synthetic a(Lcom/fiberhome/xloc/broadcast/AliveService;J)J
    .locals 1

    iput-wide p1, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->h:J

    return-wide p1
.end method

.method private a()V
    .locals 8

    const/high16 v7, 0x8000000

    const/4 v6, 0x1

    new-instance v0, Landroid/app/Notification$Builder;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V

    new-instance v1, Landroid/widget/RemoteViews;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getPackageName()Ljava/lang/String;

    move-result-object v2

    const v3, 0x7f03000e

    invoke-direct {v1, v2, v3}, Landroid/widget/RemoteViews;-><init>(Ljava/lang/String;I)V

    new-instance v2, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    const-class v4, Lcom/waiqin365/base/login/OpenInterfaceActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v3, "alivekaoqin"

    invoke-virtual {v2, v3, v6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    iget v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->b:I

    invoke-static {v3, v4, v2, v7}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v3

    const v4, 0x7f0c006e

    invoke-virtual {v1, v4, v3}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    new-instance v3, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v4

    const-class v5, Lcom/waiqin365/base/login/OpenInterfaceActivity;

    invoke-direct {v3, v4, v5}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v4, "alivemessage"

    invoke-virtual {v3, v4, v6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    const/high16 v4, 0x20000000

    invoke-virtual {v2, v4}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    iget v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->c:I

    invoke-static {v2, v4, v3, v7}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    const v3, 0x7f0c0071

    invoke-virtual {v1, v3, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    new-instance v2, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    const-class v4, Lcom/waiqin365/base/login/OpenInterfaceActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v3, "alivedaily"

    invoke-virtual {v2, v3, v6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    iget v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->d:I

    invoke-static {v3, v4, v2, v7}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    const v3, 0x7f0c0074

    invoke-virtual {v1, v3, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    new-instance v2, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    const-class v4, Lcom/waiqin365/base/login/OpenInterfaceActivity;

    invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v3, "alivemore"

    invoke-virtual {v2, v3, v6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    iget v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->e:I

    invoke-static {v3, v4, v2, v7}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v2

    const v3, 0x7f0c0077

    invoke-virtual {v1, v3, v2}, Landroid/widget/RemoteViews;->setOnClickPendingIntent(ILandroid/app/PendingIntent;)V

    const-string/jumbo v2, ""

    invoke-virtual {v0, v2}, Landroid/app/Notification$Builder;->setTicker(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;

    const v2, 0x7f020450

    invoke-virtual {v0, v2}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;

    invoke-virtual {v0, v1}, Landroid/app/Notification$Builder;->setContent(Landroid/widget/RemoteViews;)Landroid/app/Notification$Builder;

    invoke-virtual {v0}, Landroid/app/Notification$Builder;->getNotification()Landroid/app/Notification;

    move-result-object v0

    invoke-virtual {p0, v6, v0}, Lcom/fiberhome/xloc/broadcast/AliveService;->startForeground(ILandroid/app/Notification;)V

    return-void
.end method

.method private a(J)V
    .locals 3

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    iget-object v1, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->a:Ljava/lang/Runnable;

    invoke-virtual {v0, v1, p1, p2}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    :cond_0
    return-void
.end method

.method static synthetic b(Lcom/fiberhome/xloc/broadcast/AliveService;J)V
    .locals 1

    invoke-direct {p0, p1, p2}, Lcom/fiberhome/xloc/broadcast/AliveService;->a(J)V

    return-void
.end method


# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 2

    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string/jumbo v1, "Not yet implemented"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public onCreate()V
    .locals 2

    invoke-super {p0}, Landroid/app/Service;->onCreate()V

    invoke-direct {p0}, Lcom/fiberhome/xloc/broadcast/AliveService;->a()V

    iget-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->g:J

    invoke-direct {p0, v0, v1}, Lcom/fiberhome/xloc/broadcast/AliveService;->a(J)V

    return-void
.end method

.method public onDestroy()V
    .locals 2

    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/fiberhome/xloc/broadcast/AliveService;->stopForeground(Z)V

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    iget-object v1, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->a:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    :cond_0
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    invoke-super {p0}, Landroid/app/Service;->onDestroy()V

    return-void
.end method

.method public onStartCommand(Landroid/content/Intent;II)I
    .locals 6

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-wide v2, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->h:J

    sub-long/2addr v0, v2

    const-wide/16 v2, 0x2

    iget-wide v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->f:J

    mul-long/2addr v2, v4

    iget-wide v4, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->g:J

    add-long/2addr v2, v4

    cmp-long v0, v0, v2

    if-lez v0, :cond_1

    iget-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->h:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-lez v0, :cond_1

    const-string/jumbo v0, "AS Change"

    invoke-static {v0}, Lcom/fiberhome/xloc/c/a;->a(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->i:Landroid/os/Handler;

    iget-object v1, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->a:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    :cond_0
    iget-wide v0, p0, Lcom/fiberhome/xloc/broadcast/AliveService;->g:J

    invoke-direct {p0, v0, v1}, Lcom/fiberhome/xloc/broadcast/AliveService;->a(J)V

    :cond_1
    const/4 v0, 0x1

    return v0
.end method
